package com.ittony.mapper;

import com.github.pagehelper.Page;
import com.ittony.annotation.AutoFill;
import com.ittony.dto.CategoryPageQueryDTO;
import com.ittony.entity.Category;
import com.ittony.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @AutoFill(value = OperationType.INSERT)
    void addCategory(Category category);

    Page<Category> page(CategoryPageQueryDTO categoryPageQueryDTO);

    void deleteCategoryById(Long id);

    @AutoFill(value = OperationType.UPDATE)
    void updateCategory(Category category);

    List<Category> listCategoryByType(Integer type);
}
